jvc.ui.check=new jvc_ui_check();
function jvc_ui_check(){

	this.set=function (obj){
		 var defaultvalue=obj.getAttribute("jvc.default");
		 if(defaultvalue){
		 	this.setDefault(obj,defaultvalue);
		 }
		 var type=obj.getAttribute("jvc.type");
		 if(type=="int")this.setInt(obj);
		
	
	}
	this.setDefault=function(obj,val){
		obj.value = val;
		obj.style.color = '#CCCCCC';		
		jvc.attachEvent(obj,"focus", CuleG(obj,val));	
		jvc.attachEvent(obj,"blur", CuleR(obj,val));
	
	}
	this.setInt=function(obj){		
		 jvc.attachEvent(obj,"keyup", checkint_onkeyup(obj));
	}
	
}
var checkint_onkeyup=function(obj){
	 return function(){	
	 	obj.value=obj.value.replace(/[^\d\.]/g,'');	 	 	
	 }
}

var CuleG=function(s,val){
   return function(){
	if (s.value == val) {
		s.value = '';
		s.style.color = '';
	}
	}
}
var CuleR=function(s,val){
 return function(){
	if (s.value == '') {
		s.value = val;
		s.style.color = '#CCCCCC';
	}}
}
